<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <link rel="stylesheet" th:href="@{/css/main.css}" />
    <title>SpringMVC5+Thymeleaf示例</title>
</head>
<body>
<h2>Spring MVC5 + Thymeleaf对象属性格式化输出</h2>

<h2>产品信息</h2>
<dl>
    <dt>产品名称:</dt>
    <dd th:text="${product.description}">葡萄干</dd>

    <dt>产品价格:</dt>
    <dd th:text="${'$$$$$$$$$$' + #numbers.formatDecimal(product.price, 1, 2)}">350</dd>

    <dt>产品有效时间:</dt>
    <dd th:text="${#dates.format(product.availableFrom, 'yyyy-MM-dd')}">28-Jun-2018</dd>
</dl>
</body>
</html>